﻿using System.IdentityModel.Selectors;
using System.ServiceModel;
using FU.Capstones.IMS.Services.DAOs;

namespace FU.Capstones.IMS.Services.Management
{
    public class Authenticator : UserNamePasswordValidator
    {
        #region Overrides of UserNamePasswordValidator

        public override void Validate(string userName, string password)
        {
            AccountDAO accountDAO = new AccountDAO();
            bool isValid = accountDAO.Validate(userName, password);
            if (isValid)
            {
                throw new FaultException("Tên và mật khẩu không đúng.");
            }
        }

        #endregion
    }
}